<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="common/include :: header('部门新增')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-employee-add">
			<input id="source" name="source" type="hidden" value="1"/>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">姓名：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="name" id="name" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">邮箱：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="email" id="email" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">年龄：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="age" id="age" required>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">是否超管：</label>
				<div class="col-sm-8">
					<select name="admin" th:with="type=${@dict.getType('bus_admin')}">
						<option th:each="dict : ${type}" th:text="${dict.label}" th:value="${dict.value}" ></option>
					</select>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label is-required">入职时间：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="hiredate" id="hiredate" required>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">所在部门：</label>
				<div class="col-sm-8">
					<select name="deptId" th:with="type=${@departmentServiceImpl.list()}">
						<option th:each="dict : ${type}" th:text="${dict.name}" th:value="${dict.id}" ></option>
					</select>
				</div>
			</div>

		</form>
	</div>
	<th:block th:include="common/include :: footer" />
	<th:block th:include="common/include :: datetimepicker" />

	<script type="text/javascript">

		$("input[name='hiredate']").datetimepicker({
			format: "yyyy-mm-dd hh:ii",
			autoclose: true
		});

		var prefix = ctx + "/business/employee";

		function submitHandler() {
	        if ($.validate.form()) {
	        	$.operate.save(prefix + "/add", $('#form-employee-add').serialize());
	        }
	    }
	</script>
</body>
</html>
